/**
 * Project Name:design-pattern <br/>
 * File Name:TurkeyAdapter.java <br/>
 * Package Name:com.ftu.study.pattern.adapter <br/>
 */
package com.ftu.study.pattern.adapter;

/**
 * <p>  </p>
 * @version 1.0 2018年12月3日 mq 修改内容:初版
 */
public class TurkeyAdapter implements Duck {
    Turkey turkey;
    /**
     * <p>创建一个新的TurkeyAdapter实例. </p>
     */
    public TurkeyAdapter(Turkey turkey) {
        this.turkey = turkey;
    }

    /* (non-Javadoc)
     * @see com.ftu.study.pattern.adapter.Duck#quack()
     */
    @Override
    public void quack() {
        turkey.gobble();
    }

    /* (non-Javadoc)
     * @see com.ftu.study.pattern.adapter.Duck#fly()
     */
    @Override
    public void fly() {
        for(int i = 0; i < 5; i++) {
            turkey.fly();
        }
    }

}
